<template>
  <div class="mine">
    <div class="mine-header">
      <img :src="headerIcon" class="mine-header-icon">
      <p class="mine-header-username">{{username}}</p>
    </div>
    <div class="container">
      <div class="group">
        <div class="order">
          <p class="title">我的订单</p>
          <div class="list">
            <router-link class="order-item movie" to="/movieOrder">
              <p>电影</p>
            </router-link>
            <router-link class="order-item store" to="">
              <p>商城</p>
            </router-link>
          </div>
        </div>
      </div>
      <div class="group">
        <van-cell-group>
          <van-cell title="优惠券" is-link />
          <van-cell title="折扣卡" is-link />
          <van-cell title="退出登录" @click="delUserInfo" to="/login"/>
        </van-cell-group>
      </div>
    </div>
  </div>
</template>

<script>
import { mapMutations, mapState } from 'vuex'
export default {
  name: 'Mine',
  computed: {
    ...mapState('user', ['username', 'headerIcon'])
  },
  methods: {
    ...mapMutations('user', ['delUserInfo'])
  }
}
</script>

<style lang="scss" scoped>
.mine {
  flex: 1;
  font-size: 14px;
  color: #777;
  background-color: #eee;
  &-header{
    background-color: #f03d37;
    background-image: url(https://s0.meituan.net/bs/file/?f=myfe/canary:static/deploy/dpmmweb/client/dpmmweb/component/mycenter/img/bg.png);
    background-repeat: no-repeat;
    background-position: 50%;
    background-size: 100% 150px;
    height: 150px;
    overflow: hidden;
    text-align: center;
    &-icon{
      display: inline-block;
      margin-top: 30px;
      width: 60px;
      height: 60px;
      border-radius: 60px;
      border: 3px solid #fff;
    }
    &-username{
      color: #fff;
    }
  }
  .group {
    margin-top: 10px;
    background: #fff;
    .order {
      padding: 0 15px;
      position: relative;
      overflow: hidden;
      text-align: center;
      .title {
        position: relative;
        margin: 13px 0 0;
        font-size: 15px;
        line-height: 21px;
        height: 21px;
        color: #333;
        z-index: 9;
        display: inline-block;
        width: 80px;
        background-color: #fff;
      }
      .list {
        width: 100%;
        display: flex;
        justify-content: center;
      }
      &-item {
        display: block;
        height: 100px;
        width: 50%;
        background-repeat: no-repeat;
        background-position: top;
        background-size: 42px auto;
        margin-top: 18px;
        p {
          position: relative;
          top: 53px;
          text-align: center;
          font-size: 15px;
          line-height: 21px;
          height: 21px;
          margin: 0;
          color: #333;
        }
      }
      .movie {
        background-image: url(https://s0.meituan.net/bs/file/?f=myfe/canary:static/deploy/dpmmweb/client/dpmmweb/component/mycenter/img/movie.png);
      }
      .store {
        background-image: url(https://s0.meituan.net/bs/file/?f=myfe/canary:static/deploy/dpmmweb/client/dpmmweb/component/mycenter/img/store.png);
      }
    }
  }
}

</style>
